<?php
/**
 * Created by PhpStorm.
 * User: huangpeng3
 * Date: 2018/1/31
 * Time: 下午3:35
 *
 */

namespace Home\Model;

use Think\Model;

class MandatoryModel extends Model{

    protected $tableName = 'mandatory';

    public function getAll($uid){

        $rst = $this->where('uid=' . $uid)->order('id desc')->select();
        if (isset($rst)) {
            $rtn = array();
            foreach ($rst as $k => $v) {
                array_push($rtn, $v);
            }
            return $rtn;
        } else {
            return -1;
        }
    }
}